using UnityEngine;

public class GyroscopeSteerControl : MonoBehaviour
{
	public float sensitivity = 5f;

	public float threshold = 0.15f;

	private void Update()
	{
		if (GameController.instance.playerScript.inCar)
		{
			if (Mathf.Abs(Input.acceleration.x) > threshold)
			{
				BasicInput.LeftRight = Input.acceleration.x * 0.5f * sensitivity;
			}
			else
			{
				BasicInput.LeftRight = 0f;
			}
		}
	}
}
